package com.idbk.chargestation.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.idbk.chargestation.R;
import com.idbk.chargestation.adapter.CarTypeAdapter;

import java.util.List;

/**
 * 汽车车型选择
 * @author liangzw,lupc
 *
 */
public class FragmentCarTypes extends Fragment {

	private View mView;
	public View btnBack;//返回
	public ListView mListView;//车型选择ListView;
	private Context mContext;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		mView = inflater.inflate(R.layout.fragment_car_types, container, false);

		mContext = getActivity();

		setupView();
	
		return mView;
	}

	private void setupView() {
		btnBack =  mView.findViewById(R.id.imageview_back);
		mListView = (ListView) (mView).findViewById(R.id.car_types_listview);
	}

	public void setupData(List<String> data) {
		CarTypeAdapter mAdapter = new CarTypeAdapter(data, mContext);
		mListView.setAdapter(mAdapter);
	}

}
